package jsonTask;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;


public class Demo3 {
    public static void main(String[] args) {
        String jsonStr="{\"id\":\"1500100001\",\"name\":\"施笑槐\",\"age\":\"22\",\"gender\":\"女\",\"clazz\":\"文科六班\"}";
        JSONObject jsonObject = JSON.parseObject(jsonStr);
        Object id = jsonObject.get("id");
        System.out.println(id);

        Student student = JSON.parseObject(jsonStr, Student.class);
        int age = student.getAge();
        System.out.println(age);
    }
}
